var Tasks = function () {


    return {

        //main function to initiate the module
        initDashboardWidget: function () {
            $('.tasks-widget').on('change', 'input.liChild', function () {
                $checked = $(this).closest('span');
                var isChecked = $checked.is('.checked');
                if ($(this).is(':checked')) {
                    $(this).parents('li').addClass("task-done");
                    if (!isChecked) {
                        $checked.addClass('checked');
                    }
                } else {
                    if (isChecked) {
                        $checked.removeClass('checked');
                    }
                    $(this).parents('li').removeClass("task-done");
                }
            });

        }

    };

}();